package com.sdry.web.controller.jyy;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.sdry.service.lz.StockOutOrderService;
import com.sdry.service.lz.WarehouseService;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sdry.model.lz.Customer;
import com.sdry.model.lz.Warehouse;
import com.sdry.model.zc.ZcGeneralQueryEntity;
import com.sdry.model.zc.ZcSysUserEntity;
import com.sdry.service.lz.CustomerService;
import com.sdry.service.tdd.OthersService;
import com.sdry.service.zc.ZcInventoryManagementService;

/**
 * 
 * @ClassName StockOutController
 * @Description 入库单跳转菜单
 * @Author lz
 * @Date 2019年3月5日 10:39:13
 * @Version 1.0
 */
@Controller
@RequestMapping("/jyJumpPageMenu")
public class JyJumpPageMenu {

	 @Resource
	 CustomerService  customerService;
	 @Resource
	 StockOutOrderService stockOutService;
	
     @Resource
     WarehouseService warehouseService;

	//收货
	@RequestMapping("/receivingNote")
	public String receivingNote(Model model,HttpSession session,HttpServletResponse response){
		ZcSysUserEntity staf = (ZcSysUserEntity) session.getAttribute("user");
		 if(staf.getRoleId().equals("20010,")) {
			 Customer customer=customerService.queryCustomerlxrById(staf.getCustomer_id());
				Warehouse warehouse=warehouseService.queryWarehouse();
				model.addAttribute("charger", warehouse.getCharger());
				model.addAttribute("chargertel", warehouse.getChargertel());
			 model.addAttribute("cname", customer.getCustomer_name());
			 model.addAttribute("cid", staf.getCustomer_id());
			 model.addAttribute("sid", staf.getCustomer_id());
			 model.addAttribute("lname", customer.getContacts_name());
			 return "/jy/receiving/receivingNote2";
		 }else {
		List<Customer> customer_type0 = stockOutService.queryAllCustomerByType();
		Warehouse warehouse=warehouseService.queryWarehouse();
		model.addAttribute("charger", warehouse.getCharger());
		model.addAttribute("chargertel", warehouse.getChargertel());
		model.addAttribute("customer_type0", customer_type0);
		return "/jy/receiving/receivingNote";
		 }
	}
	
	/**
	 * 去上架页面
	 * @return
	 */
	@RequestMapping("/toUp")
	public String toUp(Model model) {
		/*ZcGeneralQueryEntity zcGeneralQueryEntity = new ZcGeneralQueryEntity();
		List<Warehouse> allWarehouseList = zcInventoryManagementService.selectAllWarehouseList(zcGeneralQueryEntity);
		model.addAttribute("allWarehouseList", allWarehouseList);*/
		return "jy/up/up";
	}

	/**
	 * 质检管理
	 * @return
	 */
	@RequestMapping("/receiveDetailQuality")
	public String receiveDetailQuality () {
		return "jy/receiveDetailQuality/receiveDetailQuality";
	}
	
	/*=======调账管理=======*/
}
